﻿#if No_No_no_Error
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class InkManager : MonoBehaviour
{

	public float volumeMax;


	public float currentVolume;


	public float percent;

	public static InkManager _instance;

	float reducePercent;

	void Awake ()
	{
		_instance = this;
	}

	// Use this for initialization
	void Start ()
	{
		currentVolume = percent * volumeMax;
		if (GameManager._instance._mode == 0)
			reducePercent = 1.0f;
		else
			reducePercent = 0.5f;
	}
	
	// Update is called once per frame
	void Update ()
	{
		//Debug.Log ("Ink " + currentVolume);
		UIManager._uiManager.SetInkProgress (currentVolume);
	}

	public void ReduceInk (int _reduce)
	{
		if (_reduce < 100) {
			if (currentVolume - (float)_reduce * reducePercent / (float)100 > 0.0f)
				currentVolume -= (float)_reduce * reducePercent / (float)100;
			else
				currentVolume = 0.0f;
		} else
			currentVolume = 0.0f;
	}
}
#endif